package com.sys.service.impl;

import com.sys.dao.model.RightSettings;
import com.sys.base.service.BaseGftServiceImpl;
import com.sys.plat.bean.PageBean;
import com.sys.service.RightSettingsService;

public class RightSettingsServiceImpl extends BaseGftServiceImpl implements RightSettingsService {

    public void listRightSettings(PageBean pageBean) {
        pageBean.setHql("From RightSettings");
        this.page(pageBean);
    }

    public RightSettings editRightSettings(RightSettings rightSettings) {
        return (RightSettings) this.dao.getObject(RightSettings.class, rightSettings.getId());
    }

    public int deleteRightSettings(String[] ids) {
        return delObject(ids, RightSettings.class);
    }

//    public void updateRightSettings(RightSettings rightSettings) {
//        updateObj(rightSettings);
//    }
//
//    public void addRightSettings(RightSettings rightSettings) {
//        addObj(rightSettings);
//    }

    public void addOrUpdateRightSettings(RightSettings rightSettings) {
        String id = rightSettings.getId();
        if (id == null || "".equals(id))
            addObj(rightSettings);
        else
            updateObj(rightSettings);
    }
}
